import Axios from './axios'

export function getDetail(iid) {
    return Axios({
        url: '/detail/slideShowAndData',
        params: {
            iid
        }
    })
}


export class Goods{
    constructor(baseData){
        this.iid = baseData.iid;
        this.name = baseData.name;
        this.title = baseData.title;
        this.discount = baseData.discount;
        this.priceScope = baseData.priceScope;
        this.oldPrice = baseData.oldPrice;
        this.realPrice = baseData.realPrice;
        this.sales = baseData.sales;
        this.collect = baseData.collect;
    }
}

export class Descript {
  constructor(scenic,history) {
    this.scenic = scenic;
    this.history = history;
  }
}

export class GoodsParam {
    constructor(info, rule) {
      // 注: images可能没有值(某些商品有值, 某些没有值)
      this.image = info.images ? info.images[0] : '';
      this.infos = info.set;
      this.sizes = rule.tables;
    }
  }